import 'package:json_annotation/json_annotation.dart';

part 'search_model.g.dart';

@JsonSerializable()
class SearchModel {
  int totalCount;
  bool incompleteResults;
  List<ItemModel> items;
  SearchModel({this.totalCount, this.incompleteResults, this.items});
  factory SearchModel.fromJson(Map<String, dynamic> json) =>
      _$SearchModelFromJson(json);
  Map<String, dynamic> toJson() => _$SearchModelToJson(this);
}

@JsonSerializable()
class ItemModel {
  int id;
  String name;
  String fullName;
  bool private;
  String url;
  String description;
  int size;
  String language;
  int forks;
  int stargazersCount;
  int watchers;

  ItemModel(
      {this.id,
      this.name,
      this.fullName,
      this.private,
      this.url,
      this.description,
      this.size,
      this.language,
      this.forks,
      this.stargazersCount,
      this.watchers});
  factory ItemModel.fromJson(json) => _$ItemModelFromJson(json);
  Map<String, dynamic> toJson() => _$ItemModelToJson(this);

}
